﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace prufa.Models
{
    public class ActiveGamesRepository
    {
        DefaultConnection db = new DefaultConnection();
        public IEnumerable<Mylla> GetJoinableGames()
        {
            var Joinablegames = from n in db.Myllas
                                where n.IsJoinable == true
                                select n;
            return Joinablegames;
        }
        public IEnumerable<Mylla> AllActiveGames()
        {
            var activegames = from n in db.Myllas
                              where n.IsJoinable == false
                              select n;
            return activegames;    
        }

        public IEnumerable<Risk> GetJoinableRiskGames()
        {
            var Joinablegames = from n in db.Risks
                                where n.IsJoinable == true
                                select n;
            return Joinablegames;
        }
        public IEnumerable<Risk> AllActiveRiskGames()
        {
            var activegames = from n in db.Risks
                              where n.IsJoinable == false
                              select n;
            return activegames;
        }

    }       
}